import Vue from 'vue';

export const login = (params: any) => {
    // 后端已经代理了/system/api
    return Vue.prototype.$axios.post('/system/api/login', params);
};

export const loadAddress = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/unitinfo/loadaddress', params);
}

export const getSystemConfig = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/info/sysconfig/item', params);
}

export const searchHumanName = (params: any) => {
    let {value, code} = params
    return Vue.prototype.$axios.post(`/system/api/searchHumanName?value=${value}&code=${code}`, {});
}

export const getMapConfig = (url: any) => {
    return Vue.prototype.$axios.getStatic(url, null);
}

export const getDate = (url: any) => {
    return Vue.prototype.$axios.get(url, null);
}

export const catalog = () => {
    return Vue.prototype.$axios.get('/custom/api/tab/media/catalog', null);
}

export const getallmediabyrecidandbizid = (params: any) => {
    return Vue.prototype.$axios.get('/custom/api/tab/media/getallmediabyrecidandbizid', params);
}

export const deleteMedia = (params: any) => {
    return Vue.prototype.$axios.get('/custom/api/tab/media/delete', params);
}

export const uploadMedia = (params: any) => {
    return Vue.prototype.$axios.post('/custom/api/tab/media/upload', params);
}

export const getUnitHumanTree = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/humaninfo/listtree', params);
}

export const getUnitTree = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/unitinfo/listtree', params);
}

export const getUnitRoleTree = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/roleinfo/listtree', params);
}

export const searchUnitHumanByName = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/humaninfo/search', params);
}

export const searchUnitByName = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/unitinfo/search', params);
}


export const searchUnitRoleByName = (params: any) => {
    return Vue.prototype.$axios.get('/system/api/roleinfo/search', params);
}

